home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / import1a / form1.frm (.txt) next >
Encoding:
Visual Basic Form  |  1999-10-20  |  1.5 KB  |  52 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "X Disabel"
  5.    ClientHeight    =   615
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   1455
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    ScaleHeight     =   615
  13.    ScaleWidth      =   1455
  14.    ShowInTaskbar   =   0   'False
  15.    StartUpPosition =   3  'Windows Default
  16.    Begin VB.CommandButton Command1 
  17.       Caption         =   "E&xit"
  18.       Height          =   615
  19.       Left            =   0
  20.       TabIndex        =   0
  21.       Top             =   0
  22.       Width           =   1455
  23.    End
  24. Attribute VB_Name = "Form1"
  25. Attribute VB_GlobalNameSpace = False
  26. Attribute VB_Creatable = False
  27. Attribute VB_PredeclaredId = True
  28. Attribute VB_Exposed = False
  29. Private Sub Command1_Click()
  30. End Sub
  31. Private Sub Form_Load()
  32. Dim hSysMenu As Long
  33. Dim nCnt As Long
  34. ' First, show the form
  35. ' Get handle to our form's system menu
  36. ' (Restore, Maximize, Move, close etc.)
  37. hSysMenu = GetSystemMenu(Me.hwnd, False)
  38. If hSysMenu Then
  39. ' Get System menu's menu count
  40. nCnt = GetMenuItemCount(hSysMenu)
  41. If nCnt Then
  42. ' Menu count is based on 0 (0, 1, 2, 3...)
  43. RemoveMenu hSysMenu, nCnt - 1, MF_BYPOSITION Or MF_REMOVE
  44. RemoveMenu hSysMenu, nCnt - 2, MF_BYPOSITION Or MF_REMOVE
  45. ' Remove the seperator
  46. DrawMenuBar Me.hwnd
  47. ' Force caption bar's refresh. Disabling X button
  48. Me.Caption = "Heh"
  49. End If
  50. End If
  51. End Sub
  52.